package root.electronclass.electronclass.mvp.rest

import root.electronclass.electronclass.grade.model.PersonLoginResult
import root.electronclass.electronclass.mvp.base.BaseResponse
import root.electronclass.electronclass.mvp.base.Page
import root.electronclass.electronclass.mvp.base.Pages1
import root.electronclass.electronclass.mvp.entity.*
import root.electronclass.electronclass.mvp.model.GrowthModel
import okhttp3.MultipartBody
import retrofit2.Call
import retrofit2.http.*

/**
 * 描述:接口信息.
 */
interface RestApi {
    /**
     * 设备登陆
     *
     * @param deviceID
     * @return
     */
    @POST("api/pub/dzbp/login/device/{deviceID}")
     fun deviceLogin(@Path("deviceID") deviceID: String): Call<BaseResponse<String>>

    /**
     * 升级
     */

    @GET("classManage/ecardApp/version")
    fun version(): Call<BaseResponse<VersionData>>

    /**
     * 学校信息
     *
     * @return
     */
    @GET("api/pub/dzbp/osi/self")
     fun schoolInfo(): Call<BaseResponse<OrgSchoolInfoVO>>

    /**
     * 校领导墙，年级主任
     *
     * @return
     */
    @POST("api/pub/uit/page")
     fun teacherInfo(@Body dto: TeacherDto): Call<BaseResponse<List<UserInfoTeacherVO>>>

    /**
     * 教师总数
     *
     * @return
     */
    @POST("api/pub/uit/teacherCount")
    fun teacherCount(): Call<BaseResponse<Any>>

    /**
     * 学校通知
     *
     * @return
     */
    @POST("api/pub/rcNotice/page")
    suspend  fun notice(@Body dto: SchoolNoticeDto): BaseResponse<List<NoticeData>>

    /**
     * 获取班牌信息
     *
     * @return
     */
    @GET("classManage/ecardApp/getEcardInfo")
     fun getElectorInfo(@Query("cardNo") cardNo: String): Call<BaseResponse<EcardInfo>>

    /**
     * 校园宣传
     *
     * @return
     */
    @POST("api/pub/campusPublicity/page")
    suspend fun campusPublicity(@Body dto: SchoolPropaganda): BaseResponse<List<SchoolPropagandaDto>>

    /**
     * 学习空间
     *
     * @return
     */
    @POST("api/pub/learnSpace/page")
     suspend fun learnSpace(@Body dto: LearnSpace): BaseResponse<List<LearnSpace>>

    /**
     * 科目列表
     */
    @PUT("api/pub/learnSpace/subjectList")
    fun subjectList() : Call<BaseResponse<List<Subject>>>

    /**
     * 意见箱
     *
     * @return
     */
    @POST("api/pub/ideaBox/page")
    suspend  fun ideaBox(@Body dto: IdeaBox): BaseResponse<List<IdeaBox>>

    /**
     * 刷卡
     *
     * @return
     */
    @POST("api/pub/dzbp/login/cardNo/{cardNo}")
     fun cardNo(@Path("cardNo") cardNo: String): Call<BaseResponse<String>>

    /**
     * 人脸
     *
     * @return
     */
    @POST("api/pub/dzbp/login/face")
     fun face(@Body cardNo: FaceReq): Call<BaseResponse<String>>

    @PUT("api/pub/ideaBox/edit")
     fun editIdeaBox(@Body dto: IdeaRecordReq): Call<BaseResponse<Any>>

    /**
     * 首页班级信息
     * @return
     */
    @POST("api/pub/moralStudentScore/mralTitlePage")
    fun homeClassInfo(@Body dto: ClassDto): Call<BaseResponse<List<HomeClassInfoH>>>


    /**
     * 首页今日作业表
     * @return
     */
    @GET("classManage/ecardApp/getTodayHomework")
     fun homeWorks(@Query("departId") id: String): Call<BaseResponse<List<HomeWorkInfoH>>>

    /**
     * 首页课表
     * @return
     */
    @GET("classManage/ecardApp/getTodayTimetable")
     fun homeCourse(@Query("departId") id: String): Call<BaseResponse<List<HomeCourseInfoH>>>

    /**
     * 首页班级荣誉
     * @return
     */
    @GET("classManage/ecardApp/getClassHonor")
      fun homeHonor(@Query("departId") id: String): Call<BaseResponse<List<HomeHonorInfoH>>>

    /**
     * 首页优秀学生
     * @return
     */
    @GET("classManage/ecardApp/getClassExcellentStudent")
     fun excellentStudent(
        @Query("departId") id: String,
        @Query("schoolId") schoolId: String,
        @Query("type") type: String): Call<BaseResponse<List<HomeExcellentInfoH>>>

    /**
     * 首页优秀学生
     * @return
     */
     @POST("api/pub/moralStudentScore/list2")
     fun goodStudent(@Body dto: MoralStudentDto): Call<BaseResponse<List<HomeGoodInfoH>>>

    /**
     * 首页通知
     * @return
     */
    @POST("api/pub/rcNotice/noticeDepartPage")
     fun noticeList(@Body dto:Class1Dto): Call<BaseResponse<List<HomeNoticeInfoH>>>

    /**
     * 首页通知班级
     * @return
     */
    @GET("classManage/ecardApp/getClassNotice")
    fun noticeListClass(@Query("departId") departId:String): Call<BaseResponse<List<HomeNoticeInfoHH>>>

    /**
     * 首页班级风采
     * @return
     */
    @GET("classManage/ecardApp/getClassCatch")
    fun imgList(@Query("departId") id: String): Call<BaseResponse<HomeImgInfoH>>

    /**
     * 首页留言板
     * @return
     */
    @GET("api/pub/dzbp/mmb/unread/{sendUserType}")
    fun messageList(@Path("sendUserType") type: String): Call<BaseResponse<HomeRowMsgInfoH>>

    /**HomeRowMsgInfoH
     * @return
     */
    @POST("classManage/ecardApp/examPage")
   suspend  fun examPage(@Body query: UserPageQuery): BaseResponse<Page<ExamSummary>>

    /**
     * 德育
     * @return
     */
    @POST("api/pub/moralScoreRecord/page")
    suspend  fun examPage(@Body query: MoralScoreRecord): BaseResponse<List<MoralScoreRecord>>

    /**
     * 德育
     * @return
     */
    @GET("api/pub/moralScoreRecord/get/{id}")
    fun examPageDetails(@Path("id") id: Long): Call<BaseResponse<MoralScoreRecord>>

    /**
     * 競賽下拉列表
     * @return
     */
    @GET("api/pub/moralScoreRecord/getCompetition/{departId}")
    fun moralScoreRecord(@Path("departId") userId: Long): Call<BaseResponse<List<MoralScore>>>



   /**
     * 个人成绩
     * @return
     */
   @GET("classManage/ecardApp/lastRankDetail")
   fun lastRankDetail(@Query("schoolId") schoolId: String,@Query("userId") userId: String): Call<BaseResponse<StuExamScoreDetail>>


   /**
     * 个人成绩详情
     * @return
     */
    @GET("classManage/ecardApp/examDetail")
   fun examDetail(@Query("id") schoolId: Int,@Query("userId") userId: String): Call<BaseResponse<StuExamScoreDetail>>

   /**
     * 教职工考勤
     * @return
     */
    @POST("classManage/ecardApp/saveAttn")
   fun saveAttn(@Body ecardAttnDTO: EcardAttnDTO): Call<BaseResponse<Any>>

    /**
     * 学生信息
     * @return
     */
    @GET("api/pub/uis/self")
    fun student(): Call<BaseResponse<UserInfoStudent>>

    /**
     * 学生信息
     * @return
     */
    @PUT("api/pub/uis/edit")
    fun editStudent(@Body userInfoStudent: UserInfoStudent): Call<BaseResponse<UserInfoStudent>>

    /**
     * 上传学生图片
     */
    @Multipart
    @POST("api/pub/uis/editFace/{id}")
    fun editFace(@Part file: MultipartBody.Part,@Path("id") id: Long): Call<BaseResponse<UserInfoStudent>>

    /**
     * 德育竞赛分
     */
    @POST("api/pub/moralScoreRecord/competitionScoreList")
    fun competitionScoreList(@Body record: MoralScoreRecord): Call<BaseResponse<CompetitionScore>>

    /**
     * 德育校园分
     */
    @POST("api/pub/moralScoreRecord/studentScoreList")
    fun studentScoreList(@Body record: MoralScoreRecord): Call<BaseResponse<MoralScoreRecord>>

    /**
     * 获取称号列表
     */
    @POST("api/pub/moralScoreRecord/getMoralTitle")
    fun getMoralTitle(): Call<BaseResponse<List<MoralTitle>>>


    /**
     * 修改通知状态
     */
    @PUT("api/pub/rcNotice/noticeDepartEdit")
    fun updateNotice(@Body dto: NoticeIDDto) : Call<BaseResponse<Object>>


    /**
     * 修改通知状态
     */
    @PUT("api/pub/rcNotice/edit")
   suspend fun updateNotice(@Body dto: NoticeData) : BaseResponse<Any>


    /**
     * 修改校园宣传状态
     */
    @PUT("api/pub/campusPublicity/edit")
    fun editCampusPublicity(@Body dto: editSchoolPropagandaDto) : Call<BaseResponse<Any>>


    /**
     * 文件下载
     */
    @PUT("api/pub/learnSpace/download")
    suspend fun download(@Body dto: FileDown) : BaseResponse<Any>

    /**
     * 留言板
     * @return
     */
    @POST("api/pub/dzbp/mmb/page")
    suspend fun message(@Body messageDto: MessageDto): BaseResponse<Pages1<Message>>

    /**
     * 查看留言
     * @return
     */
    @GET("api/pub/dzbp/mmb/get/{id}")
    suspend fun messageDetails(@Path("id") id: Long): BaseResponse<Message>

    @POST("api/pub/campusPoint/list")
    fun campusPoint(): Call<BaseResponse<List<CampusPoint>>>

    /**
     * 全屏通知
     * @return
     */
    @POST("api/pub/rcNotice/fullScreenNotice")
    suspend fun fullScreenNotice(): BaseResponse<NoticeData>

    /**
     * 熄屏图片
     * @return
     */
    @GET("classManage/ecardApp/listByDepartId")
    suspend fun listByDepartId(@Query("departId") departId: Long): BaseResponse<List<FullScreenImg>>

    /**
     * 校园荣誉
     * @return
     */
    @POST("api/pub/rcHonor/list")
    suspend fun rcHonorList(): BaseResponse<List<RcHonor>>

    /**
     * 校园荣誉
     * @return
     */
    @POST("api/pub/rcHonor/getRcHonorList")
    suspend fun getRcHonorList(@Body honorVo: RcHonorVo): BaseResponse<List<HonorList>>

    /**
     * 校园荣誉
     * @return
     */
    @POST("api/pub/uit/listWithFirstChar")
    suspend fun listByFirstChar(@Body queryDTO: FirstCharQueryDTO): BaseResponse<List<FirstCharTeacherDto>>

    @GET("api/pub/dzbp/login/self")
     fun loginUser(): Call<BaseResponse<PersonLoginResult>>

    @POST("api/pub/moralScoreRecord/space")
    fun space(): Call<BaseResponse<List<GrowthModel>>>


    @POST("classManage/ecardApp/getSecret")
    fun getSecret(): Call<BaseResponse<CheckPwdModel>>
}